import {http} from "@/utils/index.jsx";


export function  getSupplierListAPI(cur,pageSize){
    return http({
        method:'GET',
        url:'/supplier/list',
        params:{
            cur,pageSize
        }
    })
}

export function getSupplierInfoAPI(id) {
    return http({
        method:'GET',
        url:`/supplier/getInfo/${id}`,
        params:{
            id
        }
    })
}

export function getSupplierCountAPI() {
    return http({
        method:'GET',
        url:'/supplier/allCount',
    })
}

export function addOneSupplierAPI(OneSupplier) {
    return http({
        method:'POST',
        url:'/supplier/save',
        data:OneSupplier
    })
}

// 删除一个供应商
export function deleteOneSupplierByIdAPI(id) {
    return http({
        url:`/supplier/remove/${id}`,
        method:'DELETE',
       params:{
            id
       }
    })
}

// 修改一个供应商
export function updateOneSupplierAPI(oneSupplier) {
    return http({
        url:'/supplier/update',
        method:'put',
        data:oneSupplier
    })
}

//根据供应商名称、供应商联系人或者电话号码查询用户（用list，可能有1个或者多个）
export function getSupplierListByNameAPI(name,cur,pageSize) {
    return http({
        method:'GET',
        url:'/supplier/getByName',
        params:{
            name:name,
            cur:cur,
            pageSize:pageSize
        }
    })
}

// //根据供应商名称、供应商联系人或者电话号码查询（用list，可能有1个或者多个）数量
export function getSupplierCountByNameAPI(name) {
    return http({
        method:'GET',
        url:`/supplier/getByNameCount`,
        params:{
            name:name,
        }
    })
}



/*// 根据时间段查询供应商（用list）
export function getUserListByTimeAPI(startTime,endTime,cur,pageSize) {
    return http({
        method:'GET',
        url:'',
        params:{
            startTime,
            endTime,
            cur,
            pageSize
        }
    })
}

//根据时间段查询供应商数量
export function getSupplierCountByTimeAPI(startTime,endTime){
    return http({
        method:'GET',
        url:'',
        params:{
            startTime,endTime
        }
    })

}*/














